package com.spzx.channel.service.impl;

import com.spzx.channel.service.ListService;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.exception.ServiceException;
import com.spzx.common.core.web.page.TableDataInfo;
import com.spzx.product.api.ProductSkuFeignClient;
import com.spzx.product.api.domain.SkuQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName ListServiceImpl
 * @Author 波
 * @Date 2024/8/5 18:49
 */
@Service
public class ListServiceImpl implements ListService {

    @Autowired
    private ProductSkuFeignClient productSkuFeignClient;
    @Override
    public TableDataInfo getSkuList(Integer pageNum, Integer pageSize, SkuQuery skuQuery) {
        R<TableDataInfo> result = productSkuFeignClient.skuList(pageNum, pageSize, skuQuery, SecurityConstants.INNER);
        if(R.FAIL==result.getCode()){
            throw new ServiceException(result.getMsg());
        }
        return result.getData();
    }
}
